const request=(params)=>{
  return new Promise((resolve,reject)=>{
    wx.showLoading({
      title: '加载中',
    })
    wx.request({
      url: 'https://api-hmugo-web.itheima.net/api/'+params.url,
      method:params.method || 'GET',
      data:params.data,
      header:{Authorization:wx.getStorageSync('token') || ''},
      success:res=>{
        resolve(res.data)
        wx.hideLoading()
        wx.stopPullDownRefresh()
      }
    })
  })
}
export default request